import subprocess

result = subprocess.run(
    ['python', '-V'],
    capture_output=True,
    encoding='utf-8'
)

result.check_returncode()
print(result.stdout)
